<template>
  <div class="NewsIndex">
    <div class="mint-header">
      <mt-button icon="back" @click="back()" class="headerback" v-show="!IsShow">返回</mt-button>
      <mt-button class="headerback" v-show="IsShow">
        <span></span>
      </mt-button>
      <h1 class="headercenter">{{count}}</h1>
    </div>
    <div class="divHeght"></div>
    <transition>
      <router-view></router-view>
    </transition>
    <home-footer ref="mychild" v-if="count !== '消息详情'"></home-footer>
  </div>
</template>

<script>
import { mapState, mapMutations } from "vuex";
import HomeFooter from "../Footer";
var scan = null;
var styles = { frameColor: "#2e5dea", scanbarColor: "#2e5dea" }; //边框属性，中间线属性，背景色
var filter; //扫码格式 空为全类型
export default {
  name: "HelloWorld",
  data() {
    return {
      IsShow:true
    };
  },
  components: {
    HomeFooter
  },
  created() {
  },
  computed: {
    count() {
      return this.$store.state.userInfo;
    }
  },
  mounted() {
    this.Refs()
  },
  watch: {
    $route(to,from){
      if(to.path == '/Detils'){
        this.IsShow = false
      }else if(to.path == '/News'){
         this.IsShow = true
      }
    }
  },
  methods: {
    Refs(){
      
      this.$refs['mychild'].FooterUlliData("2");
    },
     back() {
      this.$router.go(-1);
    },
    Scan() {
      this.$router.push({ path: "/Scan" });
    }
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style>
.NewsIndex {
  width: 100%;
  height: 100%;
}
.v-enter-active,
.v-leave-active {
  transition: all 0.5s;
}
.v-enter,
.v-leave-to {
  transform: translateX(100%);
}
.mint-header {
  background-color: rgb(231, 203, 203);
  color: rgba(0, 0, 0, 0.521);
  position: fixed;
  right: 0;
  z-index: 999;
  width: 100%;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  background-color: #1785c6 !important;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  color: #fff;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  font-size: 14px;
  height: 40px;
  line-height: 1;
  padding: 0 10px;
  text-align: center;
  white-space: nowrap;
}
.NewsIndex .divHeght {
  height: 0.41rem;
}
.NewsIndex .Homeheader {
  height: 0.41rem;
}
.NewsIndex .headerback {
  width: 15%;
  text-align: left;
}
.NewsIndex .headercenter {
  width: 70%;
}
.NewsIndex .headerright {
  width: 15%;
  text-align: right;
}
.NewsIndex .i {
  font-size: 0.5rem;
  color: #f4ea2a;
}

.el-input__inner {
  font-size: 0.16rem;
  height: 0.5rem;
  padding: 0.3rem 0;
}
.mint-cell-title {
  flex: 0.8;
}
</style>
